<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								题号：<input type="text" name="problemId"/>
							</li>

							<li>
								用户名：<input type="text" name="uid"/>
							</li>

							<li>
								提交时间：<input type="text" name="submitDate"/>
							</li>

							<li>
								评判时间：<input type="text" name="judgeDate"/>
							</li>

							<li>
								占用内存：<input type="text" name="memory"/>
							</li>

							<li>
								占用时间：<input type="text" name="time"/>
							</li>

							<li>
								代码长度：<input type="text" name="codeLength"/>
							</li>

							<li>
								编程语言：<input type="text" name="language"/>
							</li>

							<li>
								程序评判结果：<input type="text" name="verdict"/>
							</li>

							<li>
								竞赛编号：<input type="text" name="contestId"/>
							</li>

							<li>
								测试用例：<input type="text" name="testcase"/>
							</li>

							<li>
								失败用例：<input type="text" name="failcase"/>
							</li>

							<li>
								评阅结果：<input type="text" name="jsonResult"/>
							</li>

							<li>
								题型代码：<input type="text" name="qtid"/>
							</li>

							<li>
								完成次数：<input type="text" name="donum"/>
							</li>

							<li>
								考试编号：<input type="text" name="ksid"/>
							</li>

							<li>
								本题得分：<input type="text" name="score"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="exam:solutions:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="exam:solutions:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="exam:solutions:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:solutions:export">
						<i class="fa fa-download"></i> 导出
				 </a>-->
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "exam/solutions";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                detailUrl: prefix + "/detail/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "解题结果",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'solutionId', 
					title : '解题号',
					visible: false
				},
				{
					field : 'problemId', 
					title : '题号',
					sortable: true
				},
				{
					field : 'uid', 
					title : '用户名',
					sortable: true
				},
				{
					field : 'submitDate', 
					title : '提交时间',
					sortable: true
				},
				{
					field : 'judgeDate', 
					title : '评判时间',
					sortable: true
				},
				{
					field : 'memory', 
					title : '占用内存',
					sortable: true
				},
				{
					field : 'time', 
					title : '占用时间',
					sortable: true
				},
				{
					field : 'codeLength', 
					title : '代码长度',
					sortable: true
				},
				{
					field : 'language', 
					title : '编程语言',
					sortable: true
				},
				{
					field : 'verdict', 
					title : '程序评判结果',
					sortable: true
				},
				{
					field : 'contestId', 
					title : '竞赛编号',
					sortable: true
				},
				{
					field : 'testcase', 
					title : '测试用例',
					sortable: true
				},
				{
					field : 'failcase', 
					title : '失败用例',
					sortable: true
				},
				{
					field : 'jsonResult', 
					title : '评阅结果',
					sortable: true
				},
				{
					field : 'qtid', 
					title : '题型代码',
					sortable: true
				},
				{
					field : 'donum', 
					title : '完成次数',
					sortable: true
				},
				{
					field : 'ksid', 
					title : '考试编号',
					sortable: true
				},
				{
					field : 'score', 
					title : '本题得分',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.solutionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.solutionId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="$.operate.detail(\'' + row.solutionId + '\')"><i class="fa fa-search"></i>详细</a>');
                        return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>